{ezscript_require(
	array('ezjsc::jquery',
		'jquery.countdown.min.js'
))}

{def $now = currentdate()
	$start = $node.data_map.time.content.timestamp
	$diff = $now|sub($start)
	$show_timing = true()}
{if or($start|gt($now), $node.data_map.time_stop.data_int)}
	{set $show_timing = false()}
{/if}
<strong class="clock-counter">{if $start|gt($now)}00:00:00{else}{$diff|sub(3600)|datetime( 'custom', '%H:%i:%s' )}{/if}</strong>
{if $show_timing}
<script type="text/javascript">
var diff = {$diff};
{literal}
	jQuery(document).ready(function() {
		$('.clock-counter').countdown({since: -diff, compact: true, format: 'HMS'});
	});
{/literal}
</script>
{/if}